Skip to content

[eas-cli] Add observe:event command to fetch a single event by ID - #4252

Draft
douglowder wants to merge 4 commits into
mainfrom
doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli
Draft

[eas-cli] Add observe:event command to fetch a single event by ID#4252
douglowder wants to merge 4 commits into
mainfrom
doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli

Conversation

@douglowder

@douglowder douglowder commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Why

Provide a new observe:event command for retrieving either metric or custom events by ID.

How

Add the new command, and associated queries that call the new event(id:) or customEvent(id:) GraphQL . The command returns whichever query finds the event, or throws if no event is found, similarly to observe:session.

Test Plan

  • New unit tests added
  • Testing on a real app in production

Stack created with GitHub Stacks CLIGive Feedback 💬

@linear-code

linear-code Bot commented Aug 21, 2026

Copy link
Copy Markdown

ENG-26000

@douglowder
douglowder requested a review from kadikraman August 21, 2026 22:44
@douglowder
douglowder force-pushed the doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli branch from 5a60109 to a75a15a Compare August 21, 2026 23:03
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.78261% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.43%. Comparing base (51ba719) to head (dd85adf).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
packages/eas-cli/src/observe/formatCustomEvents.ts 50.00% 11 Missing ⚠️
packages/eas-cli/src/observe/formatEvents.ts 53.34% 7 Missing ⚠️
...ckages/eas-cli/src/graphql/queries/ObserveQuery.ts 0.00% 6 Missing ⚠️
packages/eas-cli/src/commands/observe/event.ts 93.06% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4252      +/-   ##
==========================================
+ Coverage   64.41%   64.43%   +0.03%     
==========================================
  Files        1048     1049       +1     
  Lines       48425    48525     +100     
  Branches    10203    10230      +27     
==========================================
+ Hits        31188    31263      +75     
- Misses      17121    17146      +25     
  Partials      116      116              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@douglowder
douglowder force-pushed the doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli branch 2 times, most recently from c49a2f5 to 2b5c8c9 Compare August 24, 2026 20:10
Comment thread packages/eas-cli/src/graphql/queries/ObserveQuery.ts
@douglowder
douglowder requested a review from kadikraman August 24, 2026 21:33
Comment thread packages/eas-cli/src/commands/observe/event.ts Outdated
@douglowder
douglowder force-pushed the doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli branch from 3add66d to 814ab4f Compare August 25, 2026 02:03
@douglowder
douglowder requested a review from kadikraman August 25, 2026 02:28
@douglowder
douglowder force-pushed the doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli branch 2 times, most recently from d7e881d to 3a42e53 Compare August 27, 2026 11:18
douglowder and others added 4 commits August 28, 2026 05:03
Add `eas observe:event <ID>` to display one Observe event (metric or log) by
its ID, using the new AppObserve.event and AppObserve.customEvent GraphQL
fields. The command looks up both in one request and renders whichever
resolves; a non-existent ID errors with a not-found message.

Regenerate GraphQL from the server for the new fields, add ObserveQuery.
eventByIdAsync, extract single-event JSON mappers, and add detail formatters.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When the server returns an error (rather than null) for an unknown or
malformed event ID, observe:event surfaced an opaque "unexpected server
error" with a request ID. Wrap the lookup so plan-gate rejections still pass
through, and translate other server errors into an actionable message that
names the ID and preserves the underlying error and request ID for support.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…vent types

A custom (log) event ID is a UUID and a metric event ID is base64url-encoded
JSON, so querying both fields meant one always failed — and an unknown ID
surfaced as an opaque "unexpected server error". Classify the ID: a UUID uses
the custom-event query, a base64url value uses the metric-event query, and
anything else errors immediately as an invalid event ID. Split the combined
GraphQL lookup into two single-field queries accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@douglowder
douglowder force-pushed the doug/eng-26000-cli-fetch-a-single-observe-event-by-id-via-the-eas-cli branch from 3a42e53 to dd85adf Compare August 28, 2026 12:04
@github-actions

Copy link
Copy Markdown

✅ Thank you for adding the changelog entry!

@kadikraman

Copy link
Copy Markdown
Contributor

@douglowder let's pause this until we've updated the API - the name of the resolver will change. I'll let you know once the API changes are available.

@douglowder
douglowder marked this pull request as draft August 28, 2026 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants